package com.kevin.learn.thread;

import org.springframework.scheduling.concurrent.CustomizableThreadFactory;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class CreatePoolName {
    public static void main(String[] args) {
        createName();
    }

    public static void createName() {
        CustomizableThreadFactory threadFactory = new CustomizableThreadFactory("spring-thread");
        ThreadPoolExecutor poolExecutor = new ThreadPoolExecutor(1, 1, 100, TimeUnit.SECONDS, new LinkedBlockingDeque<>(10), threadFactory);
        poolExecutor.execute(() -> System.out.println("xxx"));
    }
}
